<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我要报名</title>
    <!--<meta name="description" content="这是一个 index 页面">-->
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/static/admin/main/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/static/admin/main/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="/static/admin/main/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/static/admin/main/assets/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="/static/admin/main/assets/css/app.css">
    <script src="/static/admin/main/assets/js/jquery.min.js"></script>

</head>

<body data-type="login">
<script src="/static/admin/main/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <div class="tpl-login">
        <div class="tpl-login-content">
            <form class="am-form myform" action="{:url('index/Person/pass')}" method="post">
                <fieldset>
                    <legend>修改密码</legend>

                    <div class="am-form-group">
                        <label>新密码</label>
                        <input type="password" class="pass" name="pass" placeholder="输入新密码">
                        <span></span>
                    </div>
                    <div class="am-form-group">
                        <label>确认密码</label>
                        <input type="password" class="repass" name="repass" placeholder="输入新密码">
                        <span></span>
                    </div>
                    <p>
                        <button type="submit" class="am-btn am-btn-default">提交</button>
                    </p>
                </fieldset>
            </form>
        </div>
    </div>
</div>
<script src="/static/admin/main/assets/js/amazeui.min.js"></script>
<script src="/static/admin/main/assets/js/app.js"></script>
{block name="myjs"}
<script>
        $(function () {
            $('.pass').blur(function () {
                var pass = $(this);
                checkmypass(pass);
            });
            $('.repass').blur(function () {
                checkRepass();
            });
            $('.myform').submit(function () {
                return (function () {
                    var pass = $('.pass');
//                    var username = $('.myusername');
                    var mypass = $('.mypass');
                    if (checkmypass(pass) && checkRepass()) {
                        return true;
                    } else {
                        return false;
                    }
                })();
                return false;
            })
        });
//
        function checkmypass(mypass) {
            var reg = /^[\w]{6,12}$/;
            if (reg.test(mypass.val())) {
                mypass.next('span').html('');
                return true;
            } else {
                mypass.next('span').css('color','red').html('密码不符合规则');
                return false;
            }
        }
        function checkRepass() {
            var pass = $('.pass');
            var repass = $('.repass');
            if (pass.val() == repass.val()) {
                repass.next('span').html('');
                return true;
            } else {
                repass.next('span').css('color','red').html('两次密码不一致');
                return false;
            }
        }
</script>
{/block}
</body>
</html>